home *** CD-ROM | disk | FTP | other *** search
- To use scripts bellow, copy each script to a separate
- MemoPad record in the "RpnPopCalc" category using Palm
- Desktop application, and then just do a HotSync.
-
- -----------------
- Script example 1:
- This script calculates box volume.
- -----------------
- #Box volume
- ?Box length:
- ?Box width:
- ?Box height:
- * *
- !Box volume is:
-
- -----------------
- Script example 2:
- This script compares all numbers on the stack and returns the largest number.
- -----------------
- #Max
- :1
- DEPTH
- 1 >
- @2
- END
- :2
- DUP
- 3 ROLL
- DUP
- 3 ROLL
- <
- @3
- SWAP
- :3
- DROP
- #An example for unconditional jump
- #Just put a non-zero number on the stack and invoke a jump
- 1
- @1
-
- -----------------
- Script example 3:
- This function calculates the factorial of a number. Because RPN PopUp
- Calculator interprets the script, it can be quite slow. One of our plans
- for the future is to make a special script editor/compiler, so scripts will
- be executed much faster.
- -----------------
- #Factorial
- ?Number:
- INT DUP 2 >=
- @1
- DROP 1 1
- @3
- :1
- DUP
- :4
- 1 -
- DUP
- 2 <
- @2
- DUP
- 3 ROLL * SWAP
- 1 @4
- :2
- DROP
- :3
- !The result is:
-
- ----------------
- Script example 4:
- This script calculates monthly payment given present value, annual interest
- rate, number of payment periods, future value and payment type (0 - payments
- are due at the end of the period, 1 - payments are due at the beginning of
- the period. This function works exactly like MS Excel PMT() function.
- ----------------
-
- #PMT (Payment)
- ?Present value:
- 0 STO DROP
- ?Future value:
- 1 STO DROP
- ?Annual interest rate (%):
- 1200 / 2 STO DROP
- ?Number of payment periods:
- 3 STO DROP
- ?Payment type (0/1):
- #0=at the end of period
- #1=at the beginning of period
- 4 STO DROP
- 2 RCL
- 0 =
- @1
- 1
- 2 RCL +
- 3 RCL POW
- 5 STO
- 0 RCL * 1 RCL +
- 1 2 RCL 4 RCL * +
- 5 RCL 1 -
- 2 RCL /
- *
- 1
- @2
- :1
- 0 RCL
- 1 RCL
- +
- 3 RCL
- :2
- /
- 2 ROUND
- CHS
- !Monthly payment is:
-